#include "cpu/exec/template-start.h"

#define instr	test

static void do_execute() {
	extern CPU_state cpu;	
	DATA_TYPE temp = op_dest->val & op_src->val;
	uint32_t i, count = 0;
	cpu.CF = 0;
	cpu.OF = 0;
	cpu.SF = MSB(temp);
	cpu.ZF = (temp == 0);
	temp &= 0xff;
	for (i = 0; i < 8; i++, temp >>= 1) {
		if ((temp & 0x1) == 0x1) {
			count++;
		}
	}
	if (count % 2 == 0) {
		cpu.PF = 1;
	}
	else {
		cpu.PF = 0;
	}
	
	print_asm_template1();
}

make_instr_helper(i2a)
make_instr_helper(i2rm)
make_instr_helper(r2rm)

#include "cpu/exec/template-end.h"
